// JavaScript Document
function check()
{
	var cond=true;
	if(document.contact.name.value.length==0)
	{
		alert("Please enter Name.");
		if(cond==true)
		{
			document.contact.name.focus();
		}
		cond=false;
		return false;
	}	
	if(document.contact.email.value.length==0)
	{
		alert("Please enter E-Mail.");
		if(cond==true)
		{
			document.contact.email.focus();
		}
		cond=false;
		return false;
	}	
	
	/*if(document.contact.phone.value.length==0)
	{
		alert("Please enter Phone.");
		if(cond==true)
		{
			document.contact.phone.focus();
		}
		cond=false;
		return false;
	}	*/
	if(document.contact.message.value=="")
	{
		alert("Please enter your Message.");
		if(cond==true)
		{
			document.contact.message.focus();
		}
		cond=false;
		return false;
	}
	else if(!checkMail(document.contact.email.value))
	{
		alert("Email must contain an email address.\n");
		if(cond==true)
		{
			document.contact.email.focus();
		}
		cond=false;
		return false;
	}
	
}	
function checkMail(email)
{
	var x = email;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) 
	{
	 return true;
	}
	else 
	{
	  return false;
	}
}
